package com.android.kotlin.activity

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import com.android.kotlin.R
import com.android.kotlin.util.Constant.USERNAME_KEY
import com.android.kotlin.util.Preference
import com.android.kotlin.util.user.UserContext
import kotlinx.android.synthetic.main.activity_login.*

class LoginActivity : AppCompatActivity() {

    private var mUserName:String by Preference(USERNAME_KEY, "未登录");

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_login)
        login.setOnClickListener {
            mUserName="大龙"
            UserContext.instance.loginSuccess(mUserName, listOf(1,2,3,4,5))
        }
    }
}
